/*******************************************************************************
    Universidad del Valle de Guatemala
    Algoritmos y estructuras de datos
    Karen Tojin   08091
    Fecha: 30 de Julio de 2009
    Descricion: Programa que simula un banco, con el uso de colas
***************************************************************************** */

/**
 *
 * @author karenAndy
 */
public class Nodo<E> {
        protected E data; // value stored in this element
        protected Nodo<E> nextElement; // ref to next

        // pre: element is a value, next is a reference to remainder of list
        // post: an element is constructed as the new head of list
        public Nodo(E element, Nodo<E> next)
        {
            data = element;
            nextElement = next;
        }

        // post: constructs a new tail of a list with value element
        public Nodo(E element)
        {
            this(element,null);
        }

        // post: returns reference to next value in list
        public Nodo<E> next()
        {
            return nextElement;
        }
        
        // post: sets reference to new next value
        public void setNext(Nodo<E> next)
        {
            nextElement = next;
        }

        // post: returns value associated with this element
        public E value()
        {
            return data;
        }

        // post: sets value associated with this element
        public void setValue(E element)
        {
            data = element;
        }
}
